-- @owner: @zhangbingliang
-- @date: 2025-07-31
-- @testpoint: D库无插件使用fetch_status函数测试，合理报错
-- @modify: modified by @zhangbingliang at 2025-07-31

--prestep1:连接到D库
@conn PrimaryDbDmode;

--step1:创建空表
drop table if exists t_fetch0011;
CREATE TABLE t_fetch0011 (ID INT);

--step2:调用游标后使用fetch_status函数查询;expect:报错
begin;
DECLARE cur_fetch0011 CURSOR FOR SELECT ID FROM t_fetch0011; /
FETCH NEXT FROM cur_fetch0011;
select @@FETCH_STATUS; 
CLOSE cur_fetch0011;
end;

--step3:清理环境
drop table if exists t_fetch0011;